import com.niit.springdemo001.dao.impl.Employee;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

//结构体注入
public class springdemotest002 {
    @Test
    public void test02(){
        Resource resource = new ClassPathResource("applicationContext.xml");
//        创建bean工厂并加载xml资源
        BeanFactory beanFactory = new XmlBeanFactory(resource);
        Employee employee = beanFactory.getBean("emp0", Employee.class);
        employee.show();
    }


}
